package Gui;

import java.io.File;
import javax.swing.JDialog;
import javax.swing.JFileChooser;

public class SaveVerticesDialog extends JDialog
{
	private static final long serialVersionUID = -8899849592710263504L;
	
	private MainWindow mainWindow;
	final JFileChooser fc = new JFileChooser();
	
	 public SaveVerticesDialog(MainWindow mWindow)
	 {
		 super(mWindow, true);
		 mainWindow = mWindow;
	 }
	 
	 public void showSaveDialog() {
		 int returnVal = fc.showSaveDialog(this);
	     if (returnVal == JFileChooser.APPROVE_OPTION) {
	    	 	File file = fc.getSelectedFile();	
	    	 	System.out.println(file.getName() );
	    	 	mainWindow.saveVertices(file.getPath());
	     }
	 }
}
